package com.asdhawaii.otello.players;

import java.util.List;
import com.asdhawaii.otello.board.Move;
import com.asdhawaii.otello.board.Square;
import com.asdhawaii.otello.board.SquareContents;

/**
 * A low-level Otello AI that selects the move that will flip the greatest number of pieces.
 * 
 * @author Branden Ogata
 *
 */

public class Level1Ai extends AbstractOtelloAi
{
  /**
   * Creates a new Level1Ai.
   * 
   * @param color The SquareContents indicating the color of the pieces for the new LevelAi.
   * 
   */
  
  public Level1Ai(SquareContents color)
  {
    super(color);
  }

  /**
   * Returns the move or one of the moves that would flip the most pieces.
   * 
   * @param board The Square[][] representing the Otello board.
   * @param moves The List<Move> containing the valid moves on the board.
   * 
   * @return A Move representing the selected move.
   * 
   */
  
  @Override
  public Move getMove(Square[][] board, List<Move> moves)
  {
    return AiStrategies.random(AiStrategies.maxima(board, moves, this.getColor()));
  }  
}